<template>
  <div class="rose-echart">
    <base-echart :option="options" />
  </div>
</template>

<script lang="ts" setup>
import BaseEchart from './base-echart.vue'
import type { EChartsOption } from 'echarts'
import { computed } from 'vue'
interface IEchartValueType {
  value: number
  name: string
}

interface IProps {
  roseData: IEchartValueType[]
}
const props = defineProps<IProps>()
const options = computed<EChartsOption>(() => {
  return {
    toolbox: {
      show: true,
      feature: {
        mark: { show: true },
        dataView: { show: true, readOnly: false },
        restore: { show: true },
        saveAsImage: { show: true }
      }
    },
    series: [
      {
        name: 'Nightingale Chart',
        type: 'pie',
        radius: [10, 140],
        center: ['50%', '50%'],
        roseType: 'area',
        itemStyle: {
          borderRadius: 8
        },
        data: props.roseData
      }
    ]
  }
})
</script>

<style lang="less" scoped>
</style>
